package com.muzi.responsibility;

/**
 * ClassName:EmergencyStopHandler
 * Package:S{PACKAGE_NAME}
 * Description:
 *
 * @Author 小雷
 * @Create 2025/5/30 14:37
 * @Version 1.0
 */
public class EmergencyStopHandler extends SafetyHandler {
    @Override
    public void handleEvent(String event) {
        if (event.equals("Emergency")) {
            System.out.println("触发紧急停车机制。");//这是触发紧急情况时采取的行为
        } else if (next != null) {
            System.out.println("紧急停车机制未执行，传递给下一个接收者。");
            next.handleEvent(event);
        }
    }
}